package com.hfxt.service.impl;

import com.hfxt.dao.UserDao;
import com.hfxt.entity.User;
import com.hfxt.service.UserService;
import org.apache.log4j.Logger;

import java.util.List;
import java.util.Map;

public class UserServiceImpl implements UserService {
    //组件的声明
    private UserDao userDao;
    private List<String> list;

    private Map<String, Object> maps;
    //创建日志对象
    private static Logger logger = Logger.getLogger(UserServiceImpl.class);


    //    public UserServiceImpl(UserDao userDao){
//        this.userDao=userDao;
//    }
    @Override
    public int addUser(User user) {

        System.out.println("add方法执行");
        int a = 10 / 0;
        userDao.addUser(user);

        return 1;
    }

    //AOP
    @Override
    public int delUser(Integer userid) {

        System.out.println("del方法执行");
        userDao.delUser(userid);

        return 1;
    }

    public void setList(List<String> list) {
        this.list = list;
    }

    public void setUserDao(UserDao userDao) {
        this.userDao = userDao;
    }

    public void setMaps(Map<String, Object> maps) {
        this.maps = maps;
    }
}
